package nayasis.common;

import java.io.File;
import java.util.Properties;
import java.util.Set;

import nayasis.common.executor.CommandLine;
import nayasis.common.log.NLogger;

import org.junit.Test;

public class CommandLineTest {

	@Test
	public void printOsProp() {
		
		NLogger.debug.println( "@", Const.platform.jvmArch );
		
		Properties properties = System.getProperties();
		
		Set<Object> keySet = properties.keySet();
		
		for( Object key : keySet ) {
			NLogger.debug.println( "@ : @", key, properties.get(key) );
		}
		
	}

	@Test
	public void execDir() {
		
		StringBuffer sb = new StringBuffer();
		
		CommandLine.exec( "cmd /c dir c:\\", sb );
		
		NLogger.debug.println( sb );
		
	}
	
	@Test
	public void openExplorer() {
		
		CommandLine.exec( "explorer " + new File( "c:/" ).getPath() );
//		CommandLine.exec( "explorer c:\\" );
		
	}
	
}
